# Contributor: Thomas Kienlen <kommander@laposte.net>
# Maintainer: Thomas Kienlen <kommander@laposte.net>
pkgname=supercronic
pkgver=0.2.29
pkgrel=0
pkgdesc="Cron for containers"
url="https://github.com/aptible/supercronic"
arch="all"
license="MIT"
makedepends="go"
checkdepends="python3"
source="supercronic-$pkgver.tar.gz::https://github.com/aptible/supercronic/archive/refs/tags/v$pkgver.tar.gz"
options="chmod-clean"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -trimpath
}

check() {
	# make unit (without -race option, -buildmode=pie not supported when -race is enabled)
	go test -v ./...
}

package() {
	install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
}

sha512sums="
87c1e0958335585bcfea023dac01bb2f4b515bd3866d9b01941fa7f614c77a211825ba86328212f0a5a02a21b0fa8d36767d4886ad5f7a2d8a691dff9bfe6fad  supercronic-0.2.29.tar.gz
"
